package com.phone.html5;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.http.MyHttpClient;
import com.xt.base.action.BaseAction;
import com.xt.yncu.approve.service.ApproveService;

public class Html5Action extends BaseAction{

	private static final long serialVersionUID = 6497668216869303500L;
	protected MyHttpClient myHttpClient;
	protected String user;
	protected String password;
	protected String orgid;
	protected String resultString;
	protected Map<String,Object> paramMap = new HashMap<String,Object>();
	protected Map<String,Object> resultMap;
	protected String paramString;
	protected String xmlString;
	protected String title;
	protected String operType;
	protected String phone;
	protected String os;
	protected int defaultpagesize=10;
	protected int pageNumber=1;
	protected int pageNumberPre=0;
	protected int pageNumberNext=0;
	protected String operType4Session="operType4Session";
	protected String scope; 
	public List<Object> list;
	protected void putBaseParam(){
		paramMap.put("user", user);
		paramMap.put("password", password);
		paramMap.put("orgid", orgid);
		paramMap.put("os", os);
		paramMap.put("phone", phone);
	}
	protected String getBaseParamString(){
		paramString = "";
		for(String key : paramMap.keySet()){
			paramString += "&"+key+"="+paramMap.get(key);
		}
		return paramString;
	}
	protected void dealPageNumber(List<Object> list){
		if(list==null || list.isEmpty()){
			pageNumberPre=0;
			pageNumberNext=0;
		}else{
			this.pageNumberPre = this.pageNumber<2?0:this.pageNumber-1;
			this.pageNumberNext=this.defaultpagesize<=list.size()?this.pageNumber+1:0;
		}
	}
	
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getOrgid() {
		return orgid;
	}
	public void setOrgid(String orgid) {
		this.orgid = orgid;
	}
	public String getResultString() {
		return resultString;
	}
	public void setResultString(String resultString) {
		this.resultString = resultString;
	}
	public Map<String, Object> getParamMap() {
		return paramMap;
	}
	public void setParamMap(Map<String, Object> paramMap) {
		this.paramMap = paramMap;
	}
	public Map<String, Object> getResultMap() {
		return resultMap;
	}
	public void setResultMap(Map<String, Object> resultMap) {
		this.resultMap = resultMap;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getOperType() {
		return operType;
	}

	public void setOperType(String operType) {
		this.operType = operType;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getOs() {
		return os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	public int getDefaultpagesize() {
		return defaultpagesize;
	}

	public void setDefaultpagesize(int defaultpagesize) {
		this.defaultpagesize = defaultpagesize;
	}

	public int getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public String getOperType4Session() {
		return operType4Session;
	}

	public void setOperType4Session(String operType4Session) {
		this.operType4Session = operType4Session;
	}

	public int getPageNumberPre() {
		return pageNumberPre;
	}

	public void setPageNumberPre(int pageNumberPre) {
		this.pageNumberPre = pageNumberPre;
	}

	public int getPageNumberNext() {
		return pageNumberNext;
	}

	public void setPageNumberNext(int pageNumberNext) {
		this.pageNumberNext = pageNumberNext;
	}

	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}


	public String getParamString() {
		return paramString;
	}

	public void setParamString(String paramString) {
		this.paramString = paramString;
	}
	public MyHttpClient getMyHttpClient() {
		return myHttpClient;
	}
	public void setMyHttpClient(MyHttpClient myHttpClient) {
		this.myHttpClient = myHttpClient;
	}
	public String getUser() {
		return user;
	}
	public void setUser(String user) {
		this.user = user;
	}
	public List<Object> getList() {
		return list;
	}
	public void setList(List<Object> list) {
		this.list = list;
	}
}
